\section{TiXmlDocument Class Reference}
\label{classTiXmlDocument}\index{TiXmlDocument@{TiXmlDocument}}
{\tt \#include $<$tinyxml.h$>$}

Inheritance diagram for TiXmlDocument::\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=3cm]{classTiXmlDocument}
\end{center}
\end{figure}


\subsection{Detailed Description}
Always the top level node. A document binds together all the XML pieces. It can be saved, loaded, and printed to the screen. The 'value' of a document node is the xml file name. \subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf TiXmlDocument} ()
\begin{CompactList}\small\item\em Create an empty document, that has no name. \item\end{CompactList}\item 
{\bf TiXmlDocument} (const char $\ast$documentName)
\begin{CompactList}\small\item\em Create a document with a name. The name of the document is also the filename of the xml. \item\end{CompactList}\item 
{\bf TiXmlDocument} (const {\bf TiXmlDocument} \&copy)
\item 
void {\bf operator=} (const {\bf TiXmlDocument} \&copy)
\item 
virtual {\bf $\sim$TiXmlDocument} ()
\item 
bool {\bf LoadFile} ({\bf TiXmlEncoding} encoding={\bf TIXML\_\-DEFAULT\_\-ENCODING})
\item 
bool {\bf SaveFile} () const 
\begin{CompactList}\small\item\em Save a file using the current document value. Returns true if successful. \item\end{CompactList}\item 
bool {\bf LoadFile} (const char $\ast$filename, {\bf TiXmlEncoding} encoding={\bf TIXML\_\-DEFAULT\_\-ENCODING})
\begin{CompactList}\small\item\em Load a file using the given filename. Returns true if successful. \item\end{CompactList}\item 
bool {\bf SaveFile} (const char $\ast$filename) const 
\begin{CompactList}\small\item\em Save a file using the given filename. Returns true if successful. \item\end{CompactList}\item 
bool {\bf LoadFile} (FILE $\ast$, {\bf TiXmlEncoding} encoding={\bf TIXML\_\-DEFAULT\_\-ENCODING})
\item 
bool {\bf SaveFile} (FILE $\ast$) const 
\begin{CompactList}\small\item\em Save a file using the given FILE$\ast$. Returns true if successful. \item\end{CompactList}\item 
virtual const char $\ast$ {\bf Parse} (const char $\ast$p, {\bf TiXmlParsingData} $\ast$data=0, {\bf TiXmlEncoding} encoding={\bf TIXML\_\-DEFAULT\_\-ENCODING})
\item 
const {\bf TiXmlElement} $\ast$ {\bf RootElement} () const 
\item 
{\bf TiXmlElement} $\ast$ {\bf RootElement} ()
\item 
bool {\bf Error} () const 
\item 
const char $\ast$ {\bf ErrorDesc} () const 
\begin{CompactList}\small\item\em Contains a textual (english) description of the error if one occurs. \item\end{CompactList}\item 
int {\bf ErrorId} () const 
\item 
int {\bf ErrorRow} () const 
\item 
int {\bf ErrorCol} () const 
\begin{CompactList}\small\item\em The column where the error occured. See \doxyref{ErrorRow()}{p.}{classTiXmlDocument_f30efc75e804aa2e92fb8be3a8cb676e}. \item\end{CompactList}\item 
void {\bf SetTabSize} (int \_\-tabsize)
\item 
int {\bf TabSize} () const 
\item 
void {\bf ClearError} ()
\item 
void {\bf Print} () const 
\item 
virtual void {\bf Print} (FILE $\ast$cfile, int depth=0) const 
\begin{CompactList}\small\item\em Print this Document to a FILE stream. \item\end{CompactList}\item 
void {\bf SetError} (int err, const char $\ast$errorLocation, {\bf TiXmlParsingData} $\ast$prevData, {\bf TiXmlEncoding} encoding)
\item 
virtual const {\bf TiXmlDocument} $\ast$ {\bf ToDocument} () const 
\begin{CompactList}\small\item\em Cast to a more defined type. Will return null not of the requested type. \item\end{CompactList}\item 
virtual {\bf TiXmlDocument} $\ast$ {\bf ToDocument} ()
\begin{CompactList}\small\item\em Cast to a more defined type. Will return null not of the requested type. \item\end{CompactList}\item 
virtual bool {\bf Accept} ({\bf TiXmlVisitor} $\ast$content) const 
\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
virtual {\bf TiXmlNode} $\ast$ {\bf Clone} () const 
\end{CompactItemize}


\subsection{Constructor \& Destructor Documentation}
\index{TiXmlDocument@{TiXmlDocument}!TiXmlDocument@{TiXmlDocument}}
\index{TiXmlDocument@{TiXmlDocument}!TiXmlDocument@{TiXmlDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}TiXmlDocument::TiXmlDocument ()}\label{classTiXmlDocument_9f5e84335708fde98400230f9f12659c}


Create an empty document, that has no name. 

\index{TiXmlDocument@{TiXmlDocument}!TiXmlDocument@{TiXmlDocument}}
\index{TiXmlDocument@{TiXmlDocument}!TiXmlDocument@{TiXmlDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}TiXmlDocument::TiXmlDocument (const char $\ast$ {\em documentName})}\label{classTiXmlDocument_e4508b452d0c3061db085f3db27b8396}


Create a document with a name. The name of the document is also the filename of the xml. 

\index{TiXmlDocument@{TiXmlDocument}!TiXmlDocument@{TiXmlDocument}}
\index{TiXmlDocument@{TiXmlDocument}!TiXmlDocument@{TiXmlDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}TiXmlDocument::TiXmlDocument (const {\bf TiXmlDocument} \& {\em copy})}\label{classTiXmlDocument_323a7486e7da6099cdc19a5ff7e74b07}


\index{TiXmlDocument@{TiXmlDocument}!$\sim$TiXmlDocument@{$\sim$TiXmlDocument}}
\index{$\sim$TiXmlDocument@{$\sim$TiXmlDocument}!TiXmlDocument@{TiXmlDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual TiXmlDocument::$\sim$TiXmlDocument ()\hspace{0.3cm}{\tt  [inline, virtual]}}\label{classTiXmlDocument_1b8a035c2c2aab38e4387246a0b712c5}




\subsection{Member Function Documentation}
\index{TiXmlDocument@{TiXmlDocument}!operator=@{operator=}}
\index{operator=@{operator=}!TiXmlDocument@{TiXmlDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void TiXmlDocument::operator= (const {\bf TiXmlDocument} \& {\em copy})}\label{classTiXmlDocument_afbfacc3414008f619b1345775ef12a4}


\index{TiXmlDocument@{TiXmlDocument}!LoadFile@{LoadFile}}
\index{LoadFile@{LoadFile}!TiXmlDocument@{TiXmlDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool TiXmlDocument::LoadFile ({\bf TiXmlEncoding} {\em encoding} = {\tt {\bf TIXML\_\-DEFAULT\_\-ENCODING}})}\label{classTiXmlDocument_4c852a889c02cf251117fd1d9fe1845f}


Load a file using the current document value. Returns true if successful. Will delete any existing document data before loading. \index{TiXmlDocument@{TiXmlDocument}!SaveFile@{SaveFile}}
\index{SaveFile@{SaveFile}!TiXmlDocument@{TiXmlDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool TiXmlDocument::SaveFile () const}\label{classTiXmlDocument_21c0aeb0d0a720169ad4ac89523ebe93}


Save a file using the current document value. Returns true if successful. 

\index{TiXmlDocument@{TiXmlDocument}!LoadFile@{LoadFile}}
\index{LoadFile@{LoadFile}!TiXmlDocument@{TiXmlDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool TiXmlDocument::LoadFile (const char $\ast$ {\em filename}, {\bf TiXmlEncoding} {\em encoding} = {\tt {\bf TIXML\_\-DEFAULT\_\-ENCODING}})}\label{classTiXmlDocument_879cdf5e981b8b2d2ef82f2546dd28fb}


Load a file using the given filename. Returns true if successful. 

\index{TiXmlDocument@{TiXmlDocument}!SaveFile@{SaveFile}}
\index{SaveFile@{SaveFile}!TiXmlDocument@{TiXmlDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool TiXmlDocument::SaveFile (const char $\ast$ {\em filename}) const}\label{classTiXmlDocument_e869f5ebf7fc54c4a1d737fb4689fd44}


Save a file using the given filename. Returns true if successful. 

\index{TiXmlDocument@{TiXmlDocument}!LoadFile@{LoadFile}}
\index{LoadFile@{LoadFile}!TiXmlDocument@{TiXmlDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool TiXmlDocument::LoadFile (FILE $\ast$ {\em file}, {\bf TiXmlEncoding} {\em encoding} = {\tt {\bf TIXML\_\-DEFAULT\_\-ENCODING}})}\label{classTiXmlDocument_41f6fe7200864d1dca663d230caf8db6}


Load a file using the given FILE$\ast$. Returns true if successful. Note that this method doesn't stream - the entire object pointed at by the FILE$\ast$ will be interpreted as an XML file. TinyXML doesn't stream in XML from the current file location. Streaming may be added in the future. \index{TiXmlDocument@{TiXmlDocument}!SaveFile@{SaveFile}}
\index{SaveFile@{SaveFile}!TiXmlDocument@{TiXmlDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool TiXmlDocument::SaveFile (FILE $\ast$ {\em fp}) const}\label{classTiXmlDocument_cf1672b4538c6d1d441f9f108aea2bf4}


Save a file using the given FILE$\ast$. Returns true if successful. 

\index{TiXmlDocument@{TiXmlDocument}!Parse@{Parse}}
\index{Parse@{Parse}!TiXmlDocument@{TiXmlDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const char $\ast$ TiXmlDocument::Parse (const char $\ast$ {\em p}, {\bf TiXmlParsingData} $\ast$ {\em data} = {\tt 0}, {\bf TiXmlEncoding} {\em encoding} = {\tt {\bf TIXML\_\-DEFAULT\_\-ENCODING}})\hspace{0.3cm}{\tt  [virtual]}}\label{classTiXmlDocument_789ad2f06f93d52bdb5570b2f3670289}


Parse the given null terminated block of xml data. Passing in an encoding to this method (either TIXML\_\-ENCODING\_\-LEGACY or TIXML\_\-ENCODING\_\-UTF8 will force TinyXml to use that encoding, regardless of what TinyXml might otherwise try to detect. 

Implements {\bf TiXmlBase} \doxyref{}{p.}{classTiXmlBase_00e4edb0219d00a1379c856e5a1d2025}.\index{TiXmlDocument@{TiXmlDocument}!RootElement@{RootElement}}
\index{RootElement@{RootElement}!TiXmlDocument@{TiXmlDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf TiXmlElement}$\ast$ TiXmlDocument::RootElement () const\hspace{0.3cm}{\tt  [inline]}}\label{classTiXmlDocument_d09d17927f908f40efb406af2fb873be}


Get the root element -- the only top level element -- of the document. In well formed XML, there should only be one. TinyXml is tolerant of multiple elements at the document level. \index{TiXmlDocument@{TiXmlDocument}!RootElement@{RootElement}}
\index{RootElement@{RootElement}!TiXmlDocument@{TiXmlDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf TiXmlElement}$\ast$ TiXmlDocument::RootElement ()\hspace{0.3cm}{\tt  [inline]}}\label{classTiXmlDocument_0b43e762a23f938b06651bc90b8a1013}


\index{TiXmlDocument@{TiXmlDocument}!Error@{Error}}
\index{Error@{Error}!TiXmlDocument@{TiXmlDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool TiXmlDocument::Error () const\hspace{0.3cm}{\tt  [inline]}}\label{classTiXmlDocument_6dfc01a6e5d58e56acd537dfd3bdeb29}


If an error occurs, Error will be set to true. Also,\begin{itemize}
\item The \doxyref{ErrorId()}{p.}{classTiXmlDocument_f96fc2f3f9ec6422782bfe916c9e778f} will contain the integer identifier of the error (not generally useful)\item The \doxyref{ErrorDesc()}{p.}{classTiXmlDocument_9d0f689f6e09ea494ea547be8d79c25e} method will return the name of the error. (very useful)\item The \doxyref{ErrorRow()}{p.}{classTiXmlDocument_f30efc75e804aa2e92fb8be3a8cb676e} and \doxyref{ErrorCol()}{p.}{classTiXmlDocument_a90bc630ee5203c6109ca5fad3323649} will return the location of the error (if known) \end{itemize}
\index{TiXmlDocument@{TiXmlDocument}!ErrorDesc@{ErrorDesc}}
\index{ErrorDesc@{ErrorDesc}!TiXmlDocument@{TiXmlDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const char$\ast$ TiXmlDocument::ErrorDesc () const\hspace{0.3cm}{\tt  [inline]}}\label{classTiXmlDocument_9d0f689f6e09ea494ea547be8d79c25e}


Contains a textual (english) description of the error if one occurs. 

\index{TiXmlDocument@{TiXmlDocument}!ErrorId@{ErrorId}}
\index{ErrorId@{ErrorId}!TiXmlDocument@{TiXmlDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int TiXmlDocument::ErrorId () const\hspace{0.3cm}{\tt  [inline]}}\label{classTiXmlDocument_f96fc2f3f9ec6422782bfe916c9e778f}


Generally, you probably want the error string ( \doxyref{ErrorDesc()}{p.}{classTiXmlDocument_9d0f689f6e09ea494ea547be8d79c25e} ). But if you prefer the ErrorId, this function will fetch it. \index{TiXmlDocument@{TiXmlDocument}!ErrorRow@{ErrorRow}}
\index{ErrorRow@{ErrorRow}!TiXmlDocument@{TiXmlDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int TiXmlDocument::ErrorRow () const\hspace{0.3cm}{\tt  [inline]}}\label{classTiXmlDocument_f30efc75e804aa2e92fb8be3a8cb676e}


Returns the location (if known) of the error. The first column is column 1, and the first row is row 1. A value of 0 means the row and column wasn't applicable (memory errors, for example, have no row/column) or the parser lost the error. (An error in the error reporting, in that case.)

\begin{Desc}
\item[See also:]\doxyref{SetTabSize}{p.}{classTiXmlDocument_51dac56316f89b35bdb7d0d433ba988e}, \doxyref{Row}{p.}{classTiXmlBase_024bceb070188df92c2a8d8852dd0853}, \doxyref{Column}{p.}{classTiXmlBase_b54bfb9b70fe6dd276e7b279cab7f003} \end{Desc}
\index{TiXmlDocument@{TiXmlDocument}!ErrorCol@{ErrorCol}}
\index{ErrorCol@{ErrorCol}!TiXmlDocument@{TiXmlDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int TiXmlDocument::ErrorCol () const\hspace{0.3cm}{\tt  [inline]}}\label{classTiXmlDocument_a90bc630ee5203c6109ca5fad3323649}


The column where the error occured. See \doxyref{ErrorRow()}{p.}{classTiXmlDocument_f30efc75e804aa2e92fb8be3a8cb676e}. 

\index{TiXmlDocument@{TiXmlDocument}!SetTabSize@{SetTabSize}}
\index{SetTabSize@{SetTabSize}!TiXmlDocument@{TiXmlDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void TiXmlDocument::SetTabSize (int {\em \_\-tabsize})\hspace{0.3cm}{\tt  [inline]}}\label{classTiXmlDocument_51dac56316f89b35bdb7d0d433ba988e}


\doxyref{SetTabSize()}{p.}{classTiXmlDocument_51dac56316f89b35bdb7d0d433ba988e} allows the error reporting functions (\doxyref{ErrorRow()}{p.}{classTiXmlDocument_f30efc75e804aa2e92fb8be3a8cb676e} and \doxyref{ErrorCol()}{p.}{classTiXmlDocument_a90bc630ee5203c6109ca5fad3323649}) to report the correct values for row and column. It does not change the output or input in any way.

By calling this method, with a tab size greater than 0, the row and column of each node and attribute is stored when the file is loaded. Very useful for tracking the DOM back in to the source file.

The tab size is required for calculating the location of nodes. If not set, the default of 4 is used. The tabsize is set per document. Setting the tabsize to 0 disables row/column tracking.

Note that row and column tracking is not supported when using operator$>$$>$.

The tab size needs to be enabled before the parse or load. Correct usage: 

\footnotesize\begin{verbatim}
		TiXmlDocument doc;
		doc.SetTabSize( 8 );
		doc.Load( "myfile.xml" );
		\end{verbatim}
\normalsize


\begin{Desc}
\item[See also:]\doxyref{Row}{p.}{classTiXmlBase_024bceb070188df92c2a8d8852dd0853}, \doxyref{Column}{p.}{classTiXmlBase_b54bfb9b70fe6dd276e7b279cab7f003} \end{Desc}
\index{TiXmlDocument@{TiXmlDocument}!TabSize@{TabSize}}
\index{TabSize@{TabSize}!TiXmlDocument@{TiXmlDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int TiXmlDocument::TabSize () const\hspace{0.3cm}{\tt  [inline]}}\label{classTiXmlDocument_612360241b85bad0826b2a9ae9cda561}


\index{TiXmlDocument@{TiXmlDocument}!ClearError@{ClearError}}
\index{ClearError@{ClearError}!TiXmlDocument@{TiXmlDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void TiXmlDocument::ClearError ()\hspace{0.3cm}{\tt  [inline]}}\label{classTiXmlDocument_c66b8c28db86363315712a3574e87c35}


If you have handled the error, it can be reset with this call. The error state is automatically cleared if you Parse a new XML block. \index{TiXmlDocument@{TiXmlDocument}!Print@{Print}}
\index{Print@{Print}!TiXmlDocument@{TiXmlDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void TiXmlDocument::Print () const\hspace{0.3cm}{\tt  [inline]}}\label{classTiXmlDocument_f08389ec70ee9b2de7f800e206a18510}


Write the document to standard out using formatted printing (\char`\"{}pretty print\char`\"{}). \index{TiXmlDocument@{TiXmlDocument}!Print@{Print}}
\index{Print@{Print}!TiXmlDocument@{TiXmlDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void TiXmlDocument::Print (FILE $\ast$ {\em cfile}, int {\em depth} = {\tt 0}) const\hspace{0.3cm}{\tt  [virtual]}}\label{classTiXmlDocument_7b1aea204fee266b70b9c105c8bf2ada}


Print this Document to a FILE stream. 



Implements {\bf TiXmlBase} \doxyref{}{p.}{classTiXmlBase_0de56b3f2ef14c65091a3b916437b512}.\index{TiXmlDocument@{TiXmlDocument}!SetError@{SetError}}
\index{SetError@{SetError}!TiXmlDocument@{TiXmlDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void TiXmlDocument::SetError (int {\em err}, const char $\ast$ {\em errorLocation}, {\bf TiXmlParsingData} $\ast$ {\em prevData}, {\bf TiXmlEncoding} {\em encoding})}\label{classTiXmlDocument_735c23e318597b920c94eae77fa206de}


\index{TiXmlDocument@{TiXmlDocument}!ToDocument@{ToDocument}}
\index{ToDocument@{ToDocument}!TiXmlDocument@{TiXmlDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual const {\bf TiXmlDocument}$\ast$ TiXmlDocument::ToDocument () const\hspace{0.3cm}{\tt  [inline, virtual]}}\label{classTiXmlDocument_1dc977bde3e4fe85a8eb9d88a35ef5a4}


Cast to a more defined type. Will return null not of the requested type. 



Reimplemented from {\bf TiXmlNode} \doxyref{}{p.}{classTiXmlNode_8a4cda4b15c29f64cff419309aebed08}.\index{TiXmlDocument@{TiXmlDocument}!ToDocument@{ToDocument}}
\index{ToDocument@{ToDocument}!TiXmlDocument@{TiXmlDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual {\bf TiXmlDocument}$\ast$ TiXmlDocument::ToDocument ()\hspace{0.3cm}{\tt  [inline, virtual]}}\label{classTiXmlDocument_1025d942a1f328fd742d545e37efdd42}


Cast to a more defined type. Will return null not of the requested type. 



Reimplemented from {\bf TiXmlNode} \doxyref{}{p.}{classTiXmlNode_6a4c8ac28ee7a745d059db6691e03bae}.\index{TiXmlDocument@{TiXmlDocument}!Accept@{Accept}}
\index{Accept@{Accept}!TiXmlDocument@{TiXmlDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool TiXmlDocument::Accept ({\bf TiXmlVisitor} $\ast$ {\em content}) const\hspace{0.3cm}{\tt  [virtual]}}\label{classTiXmlDocument_3daab2f472418ef66315750202f762ae}


Walk the XML tree visiting this node and all of its children. 

Implements {\bf TiXmlNode} \doxyref{}{p.}{classTiXmlNode_cc0f88b7462c6cb73809d410a4f5bb86}.\index{TiXmlDocument@{TiXmlDocument}!Clone@{Clone}}
\index{Clone@{Clone}!TiXmlDocument@{TiXmlDocument}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf TiXmlNode} $\ast$ TiXmlDocument::Clone () const\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classTiXmlDocument_c9e8f09b23454d953b32d1b65cd1409e}


Create an exact duplicate of this node and return it. The memory must be deleted by the caller. 

Implements {\bf TiXmlNode} \doxyref{}{p.}{classTiXmlNode_4508cc3a2d7a98e96a54cc09c37a78a4}.

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
/home/msneddon/eclipse/galileoSR1\_\-cpp/workspace/NFsim/src/NFinput/TinyXML/{\bf tinyxml.h}\item 
/home/msneddon/eclipse/galileoSR1\_\-cpp/workspace/NFsim/src/NFinput/TinyXML/{\bf tinyxml.cpp}\item 
/home/msneddon/eclipse/galileoSR1\_\-cpp/workspace/NFsim/src/NFinput/TinyXML/{\bf tinyxmlparser.cpp}\end{CompactItemize}
